﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbLoftOptions : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbLoftOptions(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbLoftOptions obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbLoftOptions()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbLoftOptions(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdDbLoftOptions() : this(TD_DbPINVOKE.new_OdDbLoftOptions__SWIG_0(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbLoftOptions(OdDbLoftOptions src) : this(TD_DbPINVOKE.new_OdDbLoftOptions__SWIG_1(OdDbLoftOptions.getCPtr(src)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbLoftOptions Assign(OdDbLoftOptions rhs)
		{
			OdDbLoftOptions result = new OdDbLoftOptions(TD_DbPINVOKE.OdDbLoftOptions_Assign(this.swigCPtr, OdDbLoftOptions.getCPtr(rhs)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double draftStart()
		{
			double result = TD_DbPINVOKE.OdDbLoftOptions_draftStart(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDraftStart(double angle)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setDraftStart(this.swigCPtr, angle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double draftEnd()
		{
			double result = TD_DbPINVOKE.OdDbLoftOptions_draftEnd(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDraftEnd(double angle)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setDraftEnd(this.swigCPtr, angle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double draftStartMag()
		{
			double result = TD_DbPINVOKE.OdDbLoftOptions_draftStartMag(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDraftStartMag(double startMag)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setDraftStartMag(this.swigCPtr, startMag);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double draftEndMag()
		{
			double result = TD_DbPINVOKE.OdDbLoftOptions_draftEndMag(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDraftEndMag(double val)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setDraftEndMag(this.swigCPtr, val);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool arcLengthParam()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_arcLengthParam(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setArcLengthParam(bool alParam)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setArcLengthParam(this.swigCPtr, alParam);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool noTwist()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_noTwist(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNoTwist(bool noTwist)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setNoTwist(this.swigCPtr, noTwist);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool alignDirection()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_alignDirection(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAlignDirection(bool alignDir)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setAlignDirection(this.swigCPtr, alignDir);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool simplify()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_simplify(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setSimplify(bool simplify)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setSimplify(this.swigCPtr, simplify);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool closed()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_closed(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setClosed(bool closed)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setClosed(this.swigCPtr, closed);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool ruled()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_ruled(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRuled(bool ruled)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setRuled(this.swigCPtr, ruled);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool virtualGuide()
		{
			bool result = TD_DbPINVOKE.OdDbLoftOptions_virtualGuide(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setVirtualGuide(bool virtGuide)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setVirtualGuide(this.swigCPtr, virtGuide);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbLoftOptions.NormalOption normal()
		{
			OdDbLoftOptions.NormalOption result = (OdDbLoftOptions.NormalOption)TD_DbPINVOKE.OdDbLoftOptions_normal(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNormal(OdDbLoftOptions.NormalOption option)
		{
			TD_DbPINVOKE.OdDbLoftOptions_setNormal(this.swigCPtr, (int)option);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdResult setOptionsFromSysvars(OdDbDatabase pDb)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_setOptionsFromSysvars(this.swigCPtr, OdDbDatabase.getCPtr(pDb));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setSysvarsFromOptions(OdDbDatabase pDb)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_setSysvarsFromOptions(this.swigCPtr, OdDbDatabase.getCPtr(pDb));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkOptions(bool displayErrorMessages)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkOptions__SWIG_0(this.swigCPtr, displayErrorMessages);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkOptions()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkOptions__SWIG_1(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkLoftCurves(OdDbEntityPtrArray crossSectionCurves, OdDbEntityPtrArray guideCurves, OdDbEntity pPathCurve, out bool allOpen, out bool allClosed, out bool allPlanar, bool displayErrorMessages)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkLoftCurves__SWIG_0(this.swigCPtr, OdDbEntityPtrArray.getCPtr(crossSectionCurves), OdDbEntityPtrArray.getCPtr(guideCurves), OdDbEntity.getCPtr(pPathCurve), out allOpen, out allClosed, out allPlanar, displayErrorMessages);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkLoftCurves(OdDbEntityPtrArray crossSectionCurves, OdDbEntityPtrArray guideCurves, OdDbEntity pPathCurve, out bool allOpen, out bool allClosed, out bool allPlanar)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkLoftCurves__SWIG_1(this.swigCPtr, OdDbEntityPtrArray.getCPtr(crossSectionCurves), OdDbEntityPtrArray.getCPtr(guideCurves), OdDbEntity.getCPtr(pPathCurve), out allOpen, out allClosed, out allPlanar);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkCrossSectionCurves(OdDbEntityPtrArray crossSectionCurves, out bool allOpen, out bool allClosed, out bool allPlanar, bool displayErrorMessages)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkCrossSectionCurves__SWIG_0(this.swigCPtr, OdDbEntityPtrArray.getCPtr(crossSectionCurves), out allOpen, out allClosed, out allPlanar, displayErrorMessages);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkCrossSectionCurves(OdDbEntityPtrArray crossSectionCurves, out bool allOpen, out bool allClosed, out bool allPlanar)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkCrossSectionCurves__SWIG_1(this.swigCPtr, OdDbEntityPtrArray.getCPtr(crossSectionCurves), out allOpen, out allClosed, out allPlanar);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkGuideCurves(OdDbEntityPtrArray guideCurves, bool displayErrorMessages)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkGuideCurves__SWIG_0(this.swigCPtr, OdDbEntityPtrArray.getCPtr(guideCurves), displayErrorMessages);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkGuideCurves(OdDbEntityPtrArray guideCurves)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkGuideCurves__SWIG_1(this.swigCPtr, OdDbEntityPtrArray.getCPtr(guideCurves));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkPathCurve(OdDbEntity pPathCurve, bool displayErrorMessages)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkPathCurve__SWIG_0(this.swigCPtr, OdDbEntity.getCPtr(pPathCurve), displayErrorMessages);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkPathCurve(OdDbEntity pPathCurve)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbLoftOptions_checkPathCurve__SWIG_1(this.swigCPtr, OdDbEntity.getCPtr(pPathCurve));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;

		public enum NormalOption
		{
			kNoNormal,
			kFirstNormal,
			kLastNormal,
			kEndsNormal,
			kAllNormal,
			kUseDraftAngles
		}
	}
}
